package com.aspose.cells;

class zrk {
   String a;
   int b;
   int c;
   long d;
   long e;
   long f;
   com.aspose.cells.b.a.zh g;
   long h;
   long i;
   long j;
   long k;
   long l;
   boolean m;

   zrk() {
      this.b = 0;
      this.c = 1;
      this.d = 4294967295L;
      this.e = 4294967295L;
      this.f = 4294967295L;
      this.g = com.aspose.cells.b.a.zh.a;
   }

   zrk(String var1, boolean var2, com.aspose.cells.b.a.zh var3) {
      this();
      this.a = var1;
      this.b = var2 ? 5 : 1;
      this.g = var3;
      this.k = var2 ? 4294967295L : 0L;
   }

   zrk(String var1, int var2, long var3) {
      this();
      this.a = var1;
      this.b = var2;
      this.l = var3;
      this.k = 4294967295L;
   }

   zrk(com.aspose.cells.b.a.d.za var1) throws Exception {
      int var2 = (int)var1.k().i();
      byte[] var3 = var1.g(64);
      if (var3.length >= 64) {
         int var4 = var1.p() & '\uffff';
         if (var4 > 0) {
            if (var4 > var3.length) {
               throw new IllegalStateException("The structured storage seems to be corrupt.");
            }

            this.a = Encoding.getUnicode().a(var3, 0, var4 - 2);
         } else {
            this.a = null;
         }

         this.b = var1.m() & 255;
         if (this.b == 0) {
            var1.k().b((long)(var2 + 128));
         } else {
            this.c = var1.m() & 255;
            this.d = var1.r();
            this.e = var1.r();
            this.f = var1.r();
            this.g = new com.aspose.cells.b.a.zh(var1.g(16));
            this.h = var1.r();
            this.i = var1.s();
            this.j = var1.s();
            this.k = var1.r();
            this.l = var1.r() & 4294967295L;
            var1.q();
         }
      }
   }

   void a(com.aspose.cells.b.a.d.zb var1) throws Exception {
      byte[] var2 = new byte[64];
      int var3;
      if (zbom.a(this.a)) {
         byte[] var4 = Encoding.getUnicode().a(this.a);
         if (var4.length > 62) {
            throw new IllegalStateException("The name '" + this.a + "' is too long for writing to structured storage.");
         }

         System.arraycopy(var4, 0, var2, 0, var4.length);
         var3 = var4.length + 2;
      } else {
         var3 = 0;
      }

      var1.a(var2);
      var1.a(var3);
      var1.a((byte)this.b);
      var1.a((byte)this.c);
      var1.a(this.d & 4294967295L);
      var1.a(this.e & 4294967295L);
      var1.a(this.f & 4294967295L);
      var1.a(this.g.a());
      var1.a(this.h & 4294967295L);
      var1.b(this.i);
      var1.b(this.j);
      var1.a(this.k & 4294967295L);
      var1.a(this.l);
      var1.b(0);
   }
}
